package com.ydy.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ydy.dao.GoodsMapper;
import com.ydy.domain.Brand;
import com.ydy.domain.Goods;
import com.ydy.domain.GoodsKind;
import com.ydy.service.GoodsService;
@Service
public class GoodsServiceImpl implements GoodsService{

	@Resource
	private GoodsMapper goodsMapper;

	@Override
	public PageInfo<Goods> list(Goods g, Integer pageNum, Integer pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		List<Goods> list = goodsMapper.list(g);
		
		return new PageInfo<Goods>(list);
	}

	@Override
	public Goods show(String id) {
		// TODO Auto-generated method stub
		
		return goodsMapper.show(id);
	}

	@Override
	public List<Brand> getBrand() {
		// TODO Auto-generated method stub
		return goodsMapper.getBrand();
	}

	@Override
	public List<GoodsKind> getGoodsKind() {
		// TODO Auto-generated method stub
		return goodsMapper.getGoodsKind();
	}

	@Override
	public void add(Goods g) {
		// TODO Auto-generated method stub
		goodsMapper.add(g);
	}

	@Override
	public void update(Goods g) {
		// TODO Auto-generated method stub
		goodsMapper.update(g);
	}

	@Override
	public int dels(Integer[] ids) {
		// TODO Auto-generated method stub
		return goodsMapper.dels(ids);
	}

	
	
}
